﻿using Microsoft.EntityFrameworkCore.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WebApplication1.A02.EntitiesPersistent;

namespace WebApplication1.Migrations
{
    [DbContext(typeof(D01DbContext))]
    partial class D01DbContextModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "3.1.5")
                .HasAnnotation("Relational:MaxIdentifierLength", 128)
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("MyMVC.A01.Entities.Department", b =>
            { 
                b.Property<Guid>("ID")
                    .ValueGeneratedOnAdd()
                    .HasColumnType("uniqueidentifier");

                b.Property<string>("Description")
                    .HasColumnType("nvarchar(1000)")
                    .HasMaxLength(1000);

                b.Property<bool>("IsActiveDepartment")
                    .HasColumnType("bit");

                b.Property<string>("Name")
                    .HasColumnType("nvarchar(50)")
                    .HasMaxLength(50);

                b.Property<Guid?>("ParentDepartmentID")
                    .HasColumnType("uniqueidentifier");

                b.Property<string>("SotCode")
                    .HasColumnType("nvarchar(150)")
                    .HasMaxLength(150);

                b.HasKey("ID");

                b.HasIndex("ParentDepartmentID");

                b.ToTable("Departments");
            });

            modelBuilder.Entity("MyMVC.A01.Entities.Employee", b =>
            {
                b.Property<Guid>("ID")
                    .ValueGeneratedOnAdd()
                    .HasColumnType("uniqueidentifier");

                b.Property<DateTime>("BirthDay")
                    .HasColumnType("datetime2");

                b.Property<Guid?>("DepartmentID")
                    .HasColumnType("uniqueidentifier");

                b.Property<string>("Description")
                    .HasColumnType("nvarchar(2000)")
                    .HasMaxLength(2000);

                b.Property<string>("Email")
                    .HasColumnType("nvarchar(100)")
                    .HasMaxLength(100);

                b.Property<string>("Mobile")
                    .HasColumnType("nvarchar(15)")
                    .HasMaxLength(15);

                b.Property<string>("Name")
                    .HasColumnType("nvarchar(10)")
                    .HasMaxLength(10);

                b.Property<bool>("Sex")
                    .HasColumnType("bit");

                b.Property<string>("SotCode")
                    .HasColumnType("nvarchar(50)")
                    .HasMaxLength(50);

                b.HasKey("ID");

                b.HasIndex("DepartmentID");

                b.ToTable("Employees");
            });

            modelBuilder.Entity("MyMVC.A01.Entities.Person", b =>
            {
                b.Property<Guid>("ID")
                    .ValueGeneratedOnAdd()
                    .HasColumnType("uniqueidentifier");

                b.Property<string>("Description")
                    .HasColumnType("nvarchar(max)");

                b.Property<string>("Email")
                    .HasColumnType("nvarchar(max)");

                b.Property<string>("Mobile")
                    .HasColumnType("nvarchar(max)");

                b.Property<string>("Name")
                    .HasColumnType("nvarchar(max)");

                b.Property<string>("SotCode")
                    .HasColumnType("nvarchar(max)");

                b.HasKey("ID");

                b.ToTable("person");
            });

            modelBuilder.Entity("MyMVC.A01.Entities.Department", b =>
            {
                b.HasOne("MyMVC.A01.Entities.Department", "ParentDepartment")
                    .WithMany()
                    .HasForeignKey("ParentDepartmentID");
            });

            modelBuilder.Entity("MyMVC.A01.Entities.Employee", b =>
            {
                b.HasOne("MyMVC.A01.Entities.Department", "Department")
                    .WithMany()
                    .HasForeignKey("DepartmentID");
            });
#pragma warning restore 612, 618
        }
    }
}
